package net.xiduth.game.player.dialogues.quests.doric;

import net.xiduth.cache.loaders.NPCDefinitions;
import net.xiduth.game.player.dialogues.Dialogue;

public class Doric extends Dialogue {

	private int npcId;

	@Override
	public void start() {
		sendEntityDialogue(
				SEND_2_TEXT_CHAT,
				new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
						"Hellow traveller, what brings you to my humble smithy?" },
				IS_NPC, npcId, 9827);
	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (player.inQuest == 1) {
			player.getDialogueManager().startDialogue("Doric3");
		} else
			sendOptionsDialogue("Doric", "I want to use your anvils..",
					"I want to use your whetstone",
					"Mind you own business, shortstuff!",
					"Ask about somthing else.");
		{
			stage = 2;
			if (stage == 1) {
				if (componentId == OPTION_1)
					sendEntityDialogue(
							SEND_2_TEXT_CHAT,
							new String[] {
									NPCDefinitions.getNPCDefinitions(npcId).name,
									"My anvils get enough work with my own use.",
									"I make pickaxes, and it takes alot of hard work.",
									"If you could me get some more materials, then I could let you us them;" },
							IS_NPC, npcId, 9827);
			} else if (componentId == OPTION_2)
				return;
			else if (componentId == OPTION_3) {
				stage = 2;
				sendOptionsDialogue("Doric", "I want to use your anvils..",
						"I want to use your whetstone",
						"Mind you own business, shortstuff!",
						"Ask about somthing else.");
			} else if (stage == 2) {
				if (componentId == OPTION_1)
					player.getDialogueManager().startDialogue("Doric2");
			} else if (componentId == OPTION_2)
				end();
		}
	}

	@Override
	public void finish() {

	}
}